package com.prs.crm.dao.oa.impl;

import java.util.List;

import org.hibernate.Criteria;
import org.hibernate.criterion.Restrictions;

import com.prs.crm.dao.impl.BaseDaoImpl;
import com.prs.crm.dao.oa.ArticleTypeDao;
import com.prs.crm.domain.oa.ArticleType;
import com.prs.crm.domain.oa.HomePage;

public class ArticleTypeDaoImpl extends BaseDaoImpl<ArticleType> implements ArticleTypeDao{

	@Override
	public List<ArticleType> getAllTypes(HomePage page) {
		Criteria criteria = this.getSession().createCriteria(ArticleType.class);
		criteria.add(Restrictions.eq("page", page));
		List<ArticleType> r= criteria.list();
		if(r.size()!=0){
			return r;
		}else{
			return null;
		}
	}

}
